<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>轮播图</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
      <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css">
      <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js">
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
		<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" action="wmSliderController.do?doUpdate" >
					<input id="id" name="id" type="hidden" value="${wmSliderPage.id }"/>
		<table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
			
					  <tr>
				    	<td align="right">
								<label class="Validform_label">
									图片:
								</label>
							</td>
							<td class="value">
							<div id="imgshow">
							</div>
								<input type="file" name="templatePic_u" id="templatePic_u" /></span>
				                  	<input type="hidden" id="photo" name="photo" value='${wmSliderPage.photo}'/>
								<span class="Validform_checktip"></span>
									<label class="Validform_label" style="display: none;">图片</label>
							</td>
						</tr>
								<tr>
						<td align="right">
							<label class="Validform_label">
								顺序:
							</label>
						</td>
						<td class="value">
						     	 <input id="sliderOrder" name="sliderOrder" type="text" style="width: 150px" class="inputxt"  datatype="n"  ignore="ignore"  value='${wmSliderPage.sliderOrder}'/>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">顺序</label>
						</td>
					</tr>
					<tr>
						<td align="right">
							<label class="Validform_label">
								路径:
							</label>
						</td>
						<td class="value" >
						  	 <input id="sliderUrl" type="text"   id="sliderUrl"  name="sliderUrl" class="inputxt" ignore="ignore" >${wmSliderPage.sliderUrl}</input>
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">路径</label>
						</td>
					</tr>
			</table>
		</t:formvalid>
		 <script type="text/javascript">
$(function () {
  
  var pics = "${tOGoodsPage.photo}";
  if(pics!=""&& pics!=null && pics!=undefined){
    var pics = pics.split(",");
    for(var i=0;i<pics.length;i++){
      $("#imgshow").append("<div><img src='"+pics[i]+"' width=\"50px;\"/><a href=\"javascript:void(0)\" class=\"jeecgDetail\" value='"+pics[i]+"' onclick=\"delPicture2(this);\">删除</a><br></div>");
    }
  }
    $("#templatePic_u").uploadify({
            buttonText:'浏览',
            progressData:'speed',
            multi:true,
            height:25,
            overrideEvents:['onDialogClose'],
            fileTypeDesc:'文件格式:',
            fileTypeExts:'*.jpg;*,jpeg;*.png;*.gif;*.bmp;*.ico;*.tif',
            fileSizeLimit:'15MB', 
            swf:'plug-in/uploadify/uploadify.swf',
            uploader:'cgformTemplateController.do?uploadPicFor',
            auto:true, 
            onUploadSuccess : function(file, data, response) {
                if(data){
                    var d=$.parseJSON(data);
                    if(d.success){
                      var srcp = "upload/"+d.obj;
                      if($("#pictures_demo").val()!="" && $("#pictures_demo").val()!=undefined){
                        $("#pictures_demo").val($("#pictures_demo").val()+","+srcp);
                      }else{
                        $("#pictures_demo").val(srcp);
                      }
                        $("#imgshow").append("<div><img src='"+srcp+"' width=\"50px;\"/><a href=\"javascript:void(0)\" class=\"jeecgDetail\" value='"+srcp+"'  onclick=\"delPicture2(this);\">删除</a><br></div>");
                    }
                }

            }  
        });
    });
</script>
 </body>
  <script src = "webpage/com/jeecg/gslider/wmSlider.js"></script>		
